<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>投资者之家--留言板</title>
    <link rel="stylesheet" href="{{$static_path}}/static/common/css/reset.css">
    <link rel="stylesheet" href="{{$static_path}}/static/common/css/swiper_2.7.css">
    <link rel="stylesheet" href="{{$static_path}}/static/common/css/header.css">
    <link rel="stylesheet" href="{{$static_path}}/static/common/css/footer.css">
    <link rel="stylesheet" href="{{$static_path}}/static/css/investors/iconfont/iconfont.css">
    <link rel="stylesheet" href="{{$static_path}}/static/css/investors/list_investors_message.css">
    <link rel="stylesheet" href="{{$static_path}}/static/common/css/common.css">
    <script src="{{$static_path}}/static/common/js/jquery-1.11.3.js"></script>
</head>

<body>
    <!-- 头部部分 -->
    {{include file="header.tpl"}}
    <!-- 内容区域 -->
    <div class="dh-main">
        <div class="zj-banner"></div>
        <div class="main-content">
            <div class="main-left">
                <div class="dh-top1">
                    <p class="h-top">投资者之家</p>
                </div>
                <ul class="dh-list">
                    {{navigation parentid="46"}}
                        {{foreach $list as $k => $v}}
                            <li> <a href="{{$v['url']}}" {{if $get.category|in_array:$v['allchildurl']}}class="dh-acitve"{{/if}}>{{$v['name']}}</a></li>
                        {{/foreach}}
                    {{/navigation}}
                </ul>
            </div>
            <div class="main-right">
                {{crumbs url=$smarty.get.category}}
                <div class="right-txt-box">
                    <h1>{{$title}}</h1>
                    <div class="wz">
                        <span class="wz-span">您的位置：<a href="/">首页</a> > {{$crumbs}} </span>
                    </div>
                </div>
                {{/crumbs}}
                <!-- 右侧的内容 -->
                <div class="box-txt">
                    <!-- <ul class="top-tabs clearfix">
                        <li class="active">你讲故事我点赞</li>
                        <li>
                            <a href="http://www.sac.net.cn/hyfw/zqjftj/zxsq/" target="_blank">
                                <img src="{{$static_path}}/static/images/investors/icon.png" alt="icon">
                                证券纠纷调解在线申请
                            </a>
                        </li>
                    </ul> -->
                    <div class="zs-tabs clearfix" style="height: 70px;">
<!--                         <p class="zs-acitve"><span class="iconfont icon-liebiao"></span>全部</p>
                        <p><span class="iconfont icon-icon-time"></span>时间</p>
                        <p><span class="iconfont icon-icon-hot"></span>热门</p> -->
                        <a class="write-btn" href="list_zj_post">
                            <img src="{{$static_path}}/static/images/investors/pen.png" alt="icon"> 写故事
                        </a>
                    </div>
                    <div class="list-tabs active" id='content'>
                        <!-- <div class="list-tabs-item clearfix">
                            <div class="list-tabs-info">
                                <img src="{{$static_path}}/static/images/investors/ava.png" class="user-img">
                                <h3>Bill Gates</h3>
                            </div>
                            <div class="list-tabs-font clearfix">
                                <span class="message-time">2016/10/10 15:30</span>
                                <div class="message-good">
                                    <span class="iconfont icon-good"></span>
                                    <p>赞(210)</p>
                                </div>
                                <h4>美国证券市场PCAOB是个什么样的机构？它的产生和该机构作用是什么？</h4>
                                <div class="font-content">
                                    证监会警示：近期，一些不法分子借“科创板”“创业板”“纳斯达克”等概念炒作，编造公司即将到上海、深圳或境外交易所上市的噱头，诱导不明真相的个人购买所谓“原始股”；有的公司在推销产品时兜售“原始股”，承诺高比例分红，吸收大量社会公众资金。这些多是骗人钱财的违法犯罪活动。
                                    <ul class="img-container clearfix">
                                        <li><img src="{{$static_path}}/static/images/investors/pic.png" alt="comment-img"></li>
                                        <li><img src="{{$static_path}}/static/images/investors/pic.png" alt="comment-img"></li>
                                        <li><img src="{{$static_path}}/static/images/investors/pic.png" alt="comment-img"></li>
                                    </ul>
                                </div>
                            </div>
                        </div> -->
                        <!-- 分页 -->
                        <div class="dywPages">

                        </div>
                    </div>
                   
                    <div class="list-tabs">
                        
                    </div>
                 
                    <div class="list-tabs">
                        
                    </div>
                </div>
                </div>
                </div>
            </div>

        </div>


    </div>

    <!--放一个id为footer的div,把footer.html加载到这块-->
    {{include file="footer.tpl"}}
    <!-- 底部部分 -->
</body>

<!-- 加载头尾 -->

<script src="{{$static_path}}/static/common/js/load.js"></script>
<script src="{{$static_path}}/static/common/js/ellipsis.js"></script>
<script src="{{$static_path}}/static/common/js/swiper_2.7.js"></script>
<script>
    $('.zs-tabs>p').click(function () {
        $(this).addClass('zs-acitve').siblings().removeClass('zs-acitve')
        $('.list-tabs').eq($(this).index()).addClass('active').siblings('.list-tabs').removeClass('active')
    })

    // 点赞
    $(document).on('click', '.message-good', function () {
        $(this).find('.icon-good').toggleClass('on')
    })

    $(document).ready(function () {
        // 超出省略
        var oEllipsis = new Ellipsis()
        
        $('.font-content').each(function (i, item) {
            var self = $(item)[0]
            oEllipsis.getOriginalContent(self)
            oEllipsis.ellipsisNormal(self, 100, ['显示全部', '收起'])
        })
    })


    /*取出留言数据*/
    $.ajax({
        type: 'POST',
        dataType: 'json',
        url: "/dynamic/dynamic-data-info-list?id=2&pageSize=5",
        // data: data,
        success: function(data){
            // console.log(data.data.list);
            if(data.code == 0){
                var list = data.data.list;
                for(var i=0; i<list.length; i++){
                    // console.log(list[i].contents[2].value);
                    // if(list[i].contents[0].name == 'pic'){
                    //     console.log(list[i].contents[0].name, 'ddd');
                    // }

                    if(list[i].member.nickname != ''){
                        var mname = list[i].member.nickname;
                    }else{
                        var mname = list[i].member.loginname;
                    }
                    if(mname.length > 5){
                        mname = mname.substr(0, 5) + '...';
                    }

                    if(list[i].member.headimgurl != ''){
                        if(list[i].member.sex == 1){
                            var headimgurl = '{{$static_path}}/static/images/login/head_portrait2.png';
                        }else{
                            var headimgurl = '{{$static_path}}/static/images/login/head_portrait1.png';
                        }
                    }else{
                        var headimgurl = '{{$static_path}}/static/images/login/head_portrait2.png';
                    }

                    var images = '';
                    if(list[i].contents[2].value != ''){
                        for(var m=0; m<list[i].contents[2].value.length; m++){
                            images += '<li><img src="' + list[i].contents[2].value[m] +'" alt="comment-img"></li>'
                        }
                    }
                    // console.log(images)
                    var html = `<div class="list-tabs-item clearfix">
                                    <div class="list-tabs-info">
                                        <img src="` + headimgurl + `" class="user-img">
                                        <h3>` + mname + `</h3>
                                    </div>
                                    <div class="list-tabs-font clearfix">
                                        <span class="message-time">` + list[i].add_time + `</span>

                                        <h4>` + list[i].contents[0].value + `</h4>
                                        <div class="font-content">
                                            ` + list[i].contents[1].value + `
                                            <ul class="img-container clearfix">` + images + `</ul>
                                        </div>
                                    </div>
                                </div>`;
                    $('#content').append(html);
                }
            }
        },
        error: function(){
      
        }
    })

</script>

</html>